//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_squadmgmtlockbuttonclicked.sqf"
#include "x_setup.sqf"

#include "x_uiinc.sqf"

private ["_grp", "_lockedgr", "_disp", "_ctrl", "_ctrl2"];
_grp = group player;
_lockedgr = GV(_grp,GVAR(locked));
disableSerialization;
_disp = __uiGetVar(X_SQUADMANAGEMENT_DIALOG);
_ctrl = _disp displayCtrl _this;
_ctrl2 = _disp displayCtrl (6000 + (_this - 7000));
if (!isNil "_lockedgr" && {_lockedgr}) then {
	_grp setVariable [QGVAR(locked), false];
	_ctrl ctrlSetText (localize "STR_DOM_MISSIONSTRING_1449");
	_ctrl2 ctrlShow false;
} else {
	_grp setVariable [QGVAR(locked), true];
	_ctrl ctrlSetText (localize "STR_DOM_MISSIONSTRING_1450");
	_ctrl2 ctrlShow true;
};